package com.ofsoft.weixin.mp.api;

/**
 * 用户黑名单接口
 * 
 * @author OF
 * @date 2018年08月21日
 */
public class UserBlackApi extends ApiBase {
	private static String getBlackList = "https://api.weixin.qq.com/cgi-bin/tags/members/getblacklist?access_token=";

	/**
	 * 获取公众号的黑名单列表
	 * 
	 * @param beginOpenid
	 *            开始open_id 当 begin_openid 为空时，默认从开头拉取。
	 * @return ApiResponse
	 */
	public static ApiResponse getBlackList(String beginOpenid) {
		return sendPost(getBlackList + AccessTokenConfig.getAccessToken(),
				ApiRequest.create("begin_openid", beginOpenid));

	}

	private static String batchBlackList = "https://api.weixin.qq.com/cgi-bin/tags/members/batchblacklist?access_token=";

	/**
	 * 批量拉黑用户
	 * 
	 * @param beginOpenid
	 *            open_id String [] 数组
	 * @return ApiResponse
	 */
	public static ApiResponse batchBlackList(String[] openidList) {
		return sendPost(batchBlackList + AccessTokenConfig.getAccessToken(),
				ApiRequest.create("openid_list", openidList));

	}

	private static String batchuNblackList = "https://api.weixin.qq.com/cgi-bin/tags/members/batchunblacklist?access_token=";

	/**
	 * 取消拉黑用户
	 * 
	 * @param openidList
	 *            open_id String [] 数组
	 * @return ApiResponse
	 */
	public static ApiResponse batchuNblackList(String[] openidList) {
		return sendPost(batchuNblackList + AccessTokenConfig.getAccessToken(),
				ApiRequest.create("openid_list", openidList));
	}
}
